import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity("articles_test")
export class ArticleEntity {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column('varchar')
  title: string;

  @Column('text')
  description: string;

  @CreateDateColumn()
  createdAt: Date;


  @CreateDateColumn()
  updatedAt: Date;

  constructor() {
    this.id = "";
    this.title = "";
    this.description = "";
    this.createdAt = new Date();
    this.updatedAt = new Date();
  }
}
export class NewArticleEntity implements Omit<ArticleEntity, 'id' | 'createdAt' | 'updatedAt'> {
  @Column('varchar')
  title: string;

  @Column('text')
  description: string;

  constructor(title: string, description: string) {
    this.title = title;
    this.description = description;
  }
}